<?php

namespace App\Http\Controllers\admin;

use App\Dao\BillDao;
use App\Exceptions\SysExceptions;
use App\Services\Code;

class BillController extends BaseController
{
    public function lists(){
        if(getIsHasPage()){
            return Code::message('',200,BillDao::get_bills_page(request()->all()));
        }
        return  view('admin.bill.bill');
    }


    /**
     * @throws SysExceptions
     */
    public function audit()
    {
        if(isPost()){
            $params = request()->all();
            BillDao::audit($params);
            return Code::message('',200);
        }
        $info = BillDao::get_one(request()->all());
        return  view('admin.bill.audit',[
            'info'=>$info
        ]);
    }
}
